﻿using System.IO;
using System.Text;

namespace YaP.Library.Extensions
{
    public static class FileStreamTools
    {
        public static string Read(this Stream fs, int offset, int count, Encoding FileEncoding)
        {
            byte[] FileBuffer = new byte[fs.Length];
            fs.Read(FileBuffer, offset, count);
            return Encoding.UTF8.GetString(FileBuffer);
        }

        //public static string BeginRead(this FileStream fs,int offset, int count, Encoding FileEncoding)
        //{
        //    byte[] FileBuffer = new byte[fs.Length];
        //    fs.BeginRead(FileBuffer,
        //}
    }
}